import React, { FC, Component } from 'react';
import PropsType from 'prop-types'

interface IState {
  name: string,
  age: number,
  sex: number
}

interface IProps {
  gender?: number,
  school?: string,
  color?: string,
  onClick?: () => void
}

class About extends Component<IProps> {
  state: IState = {
    name: 'devin',
    age: 1,
    sex: 0
  }
  render() {
    console.log(this.props)
    let { gender, school, color, onClick } = this.props;
    return <div>
      <h1>我是About组件</h1>
    </div>
  }
}

// interface IProps {
//   name: string
// }

// // FC : FunctionComponent
// const About: FC<IProps> = (props) => {
//   return <div>
//     {props.name}
//   </div>
// }

// About.PropsType = {
//   name: PropsType.string
// }

// About.defaultProps = {
//   name: 'hello world'
// }

export default About;
